package example.org;

import android.app.Service;
import android.content.Intent;
import android.content.IntentFilter;
import android.media.AudioManager;
import android.os.IBinder;
import android.widget.Toast;

public class ScreenShotService extends Service {
	private CobaReceiver receiver;

	@Override
	public IBinder onBind(Intent intent) {
		return null;
	}

	@Override
	public void onCreate() {
		super.onCreate();
		receiver = new CobaReceiver();
	}

	@Override
	public void onDestroy() {
		super.onDestroy();
		Toast.makeText(this, "Service Stop", Toast.LENGTH_SHORT).show();
		unregisterReceiver(receiver);
	}

	@Override
	public void onStart(Intent intent, int startId) {
		super.onStart(intent, startId);
		Resource.isFirstStart = true;
		IntentFilter filter = new IntentFilter(
				AudioManager.RINGER_MODE_CHANGED_ACTION);
		registerReceiver(receiver, filter);
		Toast.makeText(this, "Service Start", Toast.LENGTH_SHORT).show();
	}
}
